home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10230 < prev    next >
Encoding:
Text File  |  1996-08-05  |  2.6 KB  |  66 lines

  1. Newsgroups: comp.lang.c
  2. Path: uu4news.netcom.com!zodiac!szh
  3. From: szh@zcon.com (Syed Zaeem Hosain)
  4. Subject: Re: CONVERTING INTEGER TO ASCII??????
  5. Message-ID: <1996Mar16.013541.7285@zcon.com>
  6. Sender: szh@zcon.com (Syed Zaeem Hosain)
  7. Nntp-Posting-Host: zodiac
  8. Reply-To: szh@zcon.com
  9. Organization: Z Consulting Group
  10. References: <4ic5kp$d0g@athos.cc.bellcore.com>
  11. Date: Sat, 16 Mar 1996 01:35:41 GMT
  12.  
  13. In article <4ic5kp$d0g@athos.cc.bellcore.com>, "Sandeep V. Tamhankar" <stamhank@notes.cc.bellcore.com> writes:
  14. >Mr. Seebach, I think you've been reading this group for too long and have 
  15. >become bitter about "beginners'" questions.
  16.  
  17. *Nobody* is bitter about beginners questions, including Peter. But
  18. there is etiquette to follow for any newsgroup, and one of the simplest
  19. and easiest ones is to read the FAQ for the newsgroup before doing any
  20. posting in it!       :-)
  21.  
  22. The point is that if anybody reads the FAQ, they will see the answer to
  23. the following question:
  24.  
  25. 13.1:   How can I convert numbers to strings (the opposite of atoi)?  Is
  26.         there an itoa function?
  27.  
  28. Isn't this act (reading the FAQ, that is) quicker and easier than to
  29. post the question here (over and over and over and over and over again,
  30. ad nauseam)? Not to mention get a quicker answer without waiting for
  31. someone to respond? And also not wasting the time of the people reading
  32. the newsgroup?
  33.  
  34. I try to be polite, but some days I just want to throw things at my
  35. system when I see the *same* question for the hundredth time. Stick
  36. around long enough and you will feel the same. Then you will get a
  37. good feeling for where Peter is coming from!    :-)
  38.  
  39.  
  40. >Granted that converting an 
  41. >integer to ASCII is really easy, but people who've just started 
  42. >programming in C need time to get used to the language and its immense 
  43. >functionality.  I didn't learn about sprintf for a very long time after I 
  44. >began programming in C.  Anyway, I'm going off the point.
  45. >
  46. >Another way to convert integer to ASCII is to add char '0' to your 
  47. >integer.  Like so:
  48. >
  49. >             int asc;
  50. >             asc= known_int + '0';
  51. >
  52. >This way, you don't have to load any function and there is no overhead.
  53.  
  54. But this does not make any sense, does it? If I have a known_int with
  55. value, oh, lets say, 2134, just how does adding '0' to it convert it
  56. to ASCII?
  57.  
  58.                                 Z
  59.  
  60.  
  61. -- 
  62. -------------------------------------------------------------------------
  63. | Syed Zaeem Hosain          P. O. Box 610097            (408) 441-7021 |
  64. | Z Consulting Group        San Jose, CA 95161             szh@zcon.com |
  65. -------------------------------------------------------------------------
  66.